Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Strict' mode #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

victorsavinoff
Copy link

It is desirable (at least for me and colleagues) to be able to have some control over whether extra fields (i.e. those not present explicitly in the ruleset) should be allowed and considered valid (as it is now) or not (that's what lacks in the module). This change implements this functionality by introducing the package variable IS_DEFAULT_STRICT and a corresponding argument to the constructor (similarly to $IS_DEFAULT_AUTO_TRIM). No changes are introduced to the schema specification.
Adds a dependency on List::Util (can be easily removed though).

    Added a dependency on List::Util
modified:   lib/Validator/LIVR.pm
    Implemented strict mode to emit errors on fields that are not
    explicitly present in the rules
new file:   t/05-strict.t
    Test cases for the abovementioned
    List::Util required version set to 1.45+
@koorchik
Copy link
Owner

I need to think about it, possibly it will go to the livr spec. Like a temporary solution, it easier to create a decorator for this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants